import {
  getrejectData,
  getcheckedData,
  getauditedData,
  getremarksData
} from '@/api/data' // 导入信息相关接口


const data = {
  state: {
    search: {
      gameName: '',
      username: "",
      roId: "",
      dataTime: [],
      firstMoney: "",
      secondMoney: "",
      page: 1,
      limit: 20,
    },
  },
  getters: {
    search: state => state.search,
  },
  mutations: {
    SET_SEARCH: (state, payload) => {
      state.search = payload;
    }
  },
  actions: {
    // 获取驳回数据列表
    getrejectData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getrejectData(reqData).then(response => {
          const data = response.data
          resolve(data)
        })
      })
    },
    // 获取已通过数据列表
    getcheckedData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getcheckedData(reqData).then(response => {
          const data = response.data
          resolve(data)
        })
      })
    },
    // 获取待审核数据列表
    getauditedData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getauditedData(reqData).then(response => {
          const data = response.data
          resolve(data)
        })
      })
    },
    // 获取备注审核数据列表
    getremarksData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getremarksData(reqData).then(response => {
          const data = response.data
          resolve(data)
        })
      })
    },
    // 获取待发放数据列表
    getextendData({
      commit
    }, reqData) {
      return new Promise(resolve => {
        getextendData(reqData).then(response => {
          const data = response.data
          resolve(data)
        })
      })
    }
  }
}

export default data
